const app =getApp();
Page({
  data: {
    array: ['中国工商银行', '中国农业银行','中国建设银行'],
    index:0,
    region: ["广西壮族自治区", "贺州市", "钟山县"],
  },
  onShow:function (){
     
  },
  bindPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index: e.detail.value
    })
  },
  changeRegin(e) {
    this.setData({ region: e.detail.value });
    console.log(e.detail.value)
  },
  //保存基本资料
  formSubmit:function(e){
    console.log(e)
    console.log(this.data.region)
    wx.request({
      url: app.globalData.apiUrl+'/api/user/addBase',
      data: {data:e.detail.value,region:this.data.region,openid:app.globalData.openid},
      method: 'POST',
      dataType: 'json',
      success: function(res) {
        console.log(res)
      },
      fail: function(res) {},
      complete: function(res) {},
    })
  }
})